System and method for recognition and annotation of facial expressions

ABSTRACT

The innovation disclosed and claimed herein, in aspects thereof, comprises systems and methods of identifying AUs and emotion categories in images. The systems and methods utilized a set of images that include facial images of people. The systems and methods analyze the facial images to determine AUs and facial color due to facial blood flow variations that are indicative of an emotion category. In aspects, the analysis can include Gabor transforms to determine the AUs, AU intensities and emotion categories. In other aspects, the systems and method can include color variance analysis to determine the AUs, AU intensities and emotion categories. In further aspects, the analysis can include convolutional neural networks that are trained to determine the AUs, emotion categories and their intensities.

CROSS REFERENCE TO RELATED APPLICATIONS

This application claims the benefit of U.S. Provisional Patent Application, Ser. No. 62/343,994 entitled “SYSTEM AND METHOD FOR RECOGNITION OF ANNOTATION OF FACIAL EXPRESSIONS”, filed on Jun. 1, 2016. The entirety of the above-noted application is incorporated by reference herein.

GOVERNMENT LICENSE RIGHTS

This invention was made with government support under Grant No. R01-EY-020834 and R01-DC-014498 awarded by the National Eye Institute and the National Institute of Deafness and Other Communicative Disorders; both institutes are part of the National Institutes of Health. The government has certain rights in the invention.

BACKGROUND

Basic research in face perception and emotion theory can leverage large annotated databases of images and video sequences of facial expressions of emotion. Some of the most useful and typically needed annotations are Action Units (AUs), AU intensities, and emotion categories. While small and medium size databases can be manually annotated by expert coders over several months, large databases cannot. For example, even if it were possible to annotate each face image very fast by an expert coder (say, 20 seconds/image), it would take 5,556 hours to code a million images, which translates to 694 (8 hour) working days or 2.66 years of uninterrupted work.

Existing algorithms either do not recognize all the AUs for all applications, do not specify AU intensity, are too computational demanding in space and/or time to work with large databases, or are only tested within specific databases (e.g., even when multiple databases are used, training and testing is generally done within each database independently).

SUMMARY

The present disclosure provides a computer vision and machine learning process for the recognition of action units (AUs), their intensities, and a large number (23) of basic and compound emotion categories across databases. Crucially, the exemplified process is the first to provide reliable recognition of AUs and their intensities across databases and runs in real-time (>30 images/second). The capabilities facilitate the automatic annotations of a large database of a million facial expressions of emotion images “in the wild,” a feat not attained by any other system.

Additionally, images are annotated semantically with 421 emotion keywords.

A computer vision process for the recognition of AUs and AU intensities in images of faces is presented. Among other things, the instant process can reliably recognize AUs and AU intensities across databases. It is also demonstrated herein that the instant process can be trained using several databases to successfully recognize AUs and AU intensities on an independent database of images not used to train our classifiers. In addition, the instant process is used to automatically construct and annotate a large database of images of facial expressions of emotion. Images are annotated with AUs. AU intensities and emotion categories. The result is a database of a million images that can be readily queried by AU, AU intensity, emotion category and/or emotive keyword.

In addition, the instant process facilitates a comprehensive computer vision processes for the identification of AUs from color features. To this end, color features can be successfully exploited for the recognition of AU, yielding results that are superior to those obtained with the previous mentioned system. That is, the functions defining color change as an AU goes from inactive to active or vice-versa are consistent within AUs and differential between them. In addition, the instant process reveals how facial color changes can be exploited to identify the presence of AUs in videos filmed under a large variety of image conditions.

Additionally, facial color is used to determine the emotion of the facial expression. As described above, facial expressions of emotion in humans are produced by contracting one's facial muscles, generally called Action Units (AUs). Yet, the surface of the face is also innervated with a large network of blood vessels. Blood flow variations in these vessels yield visible color changes on the face. For example, anger increases blood flow to the face, resulting in red faces, whereas fear is associated with the drainage of blood from the face, yielding pale faces. These visible facial colors allow for the interpret of emotion in images of facial expressions even in the absence of facial muscle activation. This color signal is independent from that provided by AUs, allowing our algorithms to detect emotion from AUs and color independently.

In addition, a Global-Local loss function for Deep Neural Networks (DNNs) is presented that can be efficiently used in fine-grained detection of similar object landmark points of interest as well as AUs and emotion categories. The derived local and global loss yields accurate local results without the need to use patch-based approaches and results in fast and desirable convergences. The instant Global-Local loss function may be used for the recognition of AUs and emotion categories.

In some embodiments, the facial recognition and annotation processes are used in clinical applications.

In some embodiments, the facial recognition and annotation processes are used in detection of evaluation of psychopathologies.

In some embodiments, the facial recognition and annotation processes are used in screening for post-traumatic stressed disorder, e.g., in a military setting or an emergency room.

In some embodiments, the facial recognition and annotation processes are used for teaching children with learning disorders (e.g., Autism Spectrum Disorder) to recognize facial expressions.

In some embodiments, the facial recognition and annotation processes are used for advertising, e.g., for analysis of people looking at ads; for analysis of people viewing a movie; for analysis of people's responses in sport arenas.

In some embodiments, the facial recognition and annotation processes are used for surveillance.

In some embodiments, the recognition of emotion, AUs and other annotations are used to improve or identify web searches, e.g., the system is used to identify images of faces expressing surprise or the images of a particular person with furrowed brows.

In some embodiments, the facial recognition and annotation processes are used in retail to monitor, evaluate or determine customer behavior.

In some embodiments, the facial recognition and annotation processes are used to organize electronic pictures of an institution or individual, e.g., organize the personal picture of a person by emotion or AUs.

In some embodiments, the facial recognition and annotation processes are used to monitor patients' emotions, pain and mental state in a hospital or clinical setting, e.g., to determine the level of discomfort of a patient.

In some embodiments, the facial recognition and annotation process are used to monitor a driver's behavior and attention to the road and other vehicles.

In some embodiments, the facial recognition and annotation process are used to automatically select emoji, stickers or other texting affective components.

In some embodiments, the facial recognition and annotation process are used to improve online surveys, e.g., to monitor emotional responses of online survey participants.

In some embodiments, the facial recognition and annotation process are used in online teaching and tutoring.

In some embodiments, the facial recognition and annotation process are used to determine the fit of a job application is a specific company, e.g., a company may be looking for attentive participants, whereas another may be interested in joyful personalities. In another example, the facial recognition and annotation process are used to determine the competence of an individual during a job interview or on an online video resume.

In some embodiments, the facial recognition and annotation process are used in gaming.

In some embodiments, the facial recognition and annotation process are used to evaluate patients' responses in a psychiatrist office, clinic or hospital.

In some embodiments, the facial recognition and annotation process is used to monitor babies and children.

In an aspect, a computer-implemented method is disclosed (e.g., for analyzing an image to determine AU and AU intensity, e.g., in real-time). The method comprises maintaining, in memory (e.g., persistent memory), one or a plurality of kernel vector spaces (e.g., kernel vector space) of configural or other shape features and of shading features, wherein each kernel space is associated with one or several action units (AUs) and/or an AU intensity value and/or emotion category; receiving an image (e.g., an image of a facial expressions externally or from one or multiple databases) to be analyzed, and for each received image: i) determining face space data (e.g., face vector space) of configural, shape and shading features of a face in the image (e.g., wherein the face space includes a shape feature vector of the configural features and a shading feature vector associated with shading changes in the face); and ii) determining one or more AU values for the image by comparing the determined face space data of configural features to the plurality of kernel spaces to determine presence AUs, AU intensities and emotion categories.

In some embodiments, the method includes processing, in real-time, a video stream comprising a plurality of images to determine AU values and AU intensity values for each of the plurality of images.

In some embodiments, the face space data includes a shape feature vector of the configural features and a shading feature vector associated with shading changes in the face.

In some embodiments, the determined face space of the configural, shape and shading features comprises i) distance values (e.g., Euclidean distances) between normalized landmarks in Delaunay triangles formed from the image and ii) distances, areas and angles defined by each of the Delaunay triangles corresponding to the normalized facial landmarks.

In some embodiments, the shading feature vector associated with shading changes in the face are determined by: applying Gabor filters to normalized landmark points determined from the face (e.g., to model shading changes due to the local deformation of the skin).

In some embodiments, the shape feature vector of the configural features comprises landmark points derived using a deep neural network (e.g., a convolution neural network, DNN) comprising a global-local (GL) loss function configured to backpropagate both local and global fit of landmark points projected and/or AUs and/or emotion categories over the image.

In some embodiments, the method includes for each received image: i) determining a face space associated with a color features of the face, and ii) determining one or more AU values for the image by comparing this determined color face space to the plurality of color or kernel vector spaces, iii) modify the color of the image such that the face appears to express a specific emotion or have one or more AUs active or at specific intensities.

In some embodiments, the AU value and AU intensity value, collectively, define an emotion and an emotion intensity.

In some embodiments, the image comprises a photograph.

In some embodiments, the image comprises a frame of a video sequence.

In some embodiments, the image comprises an entire video sequence.

In some embodiments, the method includes receiving an image of a facial expression in the wild (e.g., the Internet); and processing the received image to determine an AU value and an AU intensity value and an emotion category for a face in the received image.

In some embodiments, the method includes receiving a first plurality of images from a first database; receiving a second plurality of images from a second database; and processing the received first plurality and second plurality of images to determine for each image thereof an AU value and an AU intensity value for a face in each respective image, wherein the first plurality of images has a first captured configuration and the second plurality of images has a second captured configuration, wherein the first captured configuration is different form the second captured configuration (e.g., wherein captured configuration includes lighting scheme and magnitude; image background; focal plane; capture resolution; storage compression level; pan, tilt, and yaw of the capture relative to the face, etc.).

In another aspect, a computer-implemented method is disclosed (e.g., for analyzing an image to determine AU, AU intensity and emotion category using color variation in the image). The method includes identify changes defining transition of an AU from inactive to active, wherein the changes are selected from the group consisting of chromaticity, hue and saturation, and luminance; and applying Gabor transform to the identified chromaticity changes (e.g., to gain invariance to the timing of this change during a facial expression).

In another aspect, a computer-implemented method is disclosed for analyzing an image to determine AU and AU intensity. The method includes maintaining, in memory (e.g., persistent memory), a plurality of color features data associated with an AU and/or AU intensity; receiving an image to be analyzed; and for each received image; i) determining configural color features of a face in the image; and ii) determining one or more AU values for the image by comparing the determined configural color features to the plurality of trained color feature data to determine presence of the determined configural color features in one of more of the plurality of trained color feature data.

In another aspect, a computer-implemented method is disclosed (e.g., for generating a repository of plurality of face space data each associated with an AU value and an AU intensity value, wherein the repository is used for the classification of face data in an image or video frame for AU and AU intensity). The method includes analyzing a plurality of faces in images or video frames to determine kernel space data for a plurality of AU values and AU intensity values, wherein each kernel space data is associated with a single AU value and a single AU intensity value, and wherein each kernel space is linearly or non-linearly separable to other kernel face space.

In some embodiments, the step of analyzing the plurality of faces to determine kernel space data comprises: generating a plurality of training set of AUs for a pre-defined number of AU intensity values; and performing kernel subclass discriminant analysis to determine a plurality of kernel spaces, each of the plurality of kernel spaces corresponding to kernel vector data associated with a given AU value, AU intensity value, an emotion category and the intensity of that emotion.

In some embodiments, the kernel space includes functional color space feature data of an image or a video sequence.

In some embodiments, the functional color space is determined by performing a discriminant functional learning analysis (e.g., using a maximum-margin functional classifier) on color images each derived from a given image of plurality of images.

In another aspect, a non-transitory computer readable medium is disclosed. The computer readable medium has instructions stored thereon, wherein the instructions, when executed by a processor, cause the processor to perform any of the methods described above.

In another aspect, a system is disclosed. The system comprises a processor and computer readable medium having instructions stored thereon, wherein the instructions, when executed by a processor, cause the processor to perform any of the methods described above.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a diagram illustrating the output of a computer vision process to automatically annotate emotion categories and AUs in face images in the wild.

FIG. 2, comprising FIGS. 2A and 2B, is an illustration of detected face landmarks and a Delaunay triangulation of an image.

FIG. 3 is a diagram showing a hypothetical model in which sample images with active AUs are divided into subclasses.

FIG. 4 illustrates an example component diagram of a system using Gabor transforms to determine AUs and emotion categories.

FIG. 5 illustrates a color variance system for detecting AUs using color features in video and/or still images.

FIG. 6 illustrates a color variance system for detecting AUs using color features in video and/or still images.

FIG. 7 illustrates a network system for detecting AUs using deep neural networks in video and/or still images

FIG. 8 shows an example computer system.

DETAILED DESCRIPTION

Real-Time Algorithm for the Automatic Annotation of a Million Facial Expressions in the Wild

FIG. 1 depicts a resulting database of facial expressions that can be readily queried (e.g. sorted, organized, and/or the like) by AU, AU intensity, emotion category, or emotion/affect keyword. The database facilitates the design of new computer vision algorithms as well as basic, translational and clinical studies in social and cognitive psychology, social and cognitive neuroscience, neuro-marketing, psychiatry, and/or the like.

The database is compiled of outputs of a computer vision system that automatically annotates emotion category and AU in face images in the wild (i.e. images not already curated in an existing database). The images can be downloaded using a variety of web search engines by selecting only images with faces and with associated emotion keywords in WordNet or other dictionary. FIG. 1 shows three example queries of the database. The top example is the results of two queries obtained when retrieving all images that have been identified as happy and fearful. Also shown is the number of images in the database of images in the wild that were annotated as either happy or fearful. The third depicted query shows the results of retrieving all images with AU 4 or 6 present, and images with the emotive keyword “anxiety” and “disapproval.”

AU and Intensity Recognition

In some embodiments, the system for recognizing AUs may process at over 30 images/second and is determined to be highly accurate across databases. The system achieves high recognition accuracies across databases and can run in real time. The system can facilitate categorizing facial expressions within one of twenty-three basic and/or compound emotion categories. Categorization of emotion is given by the detected AU pattern of activation. In some embodiments, an image(s) may not belong to one of the 23 categories. When this is the case, the image is annotated with AUs without an emotion category. If an image does not have any AU active, the image is classified as a neutral expression. In addition to determining emotions and emotion intensities in faces, the exemplified processes may be used to identify the “not face” in an image.

Face Space for AU and Intensity Recognition

The system starts by defining a feature space employed to represent AUs in face images. Perception of faces, and facial expressions in particular, by humans is known to involve a combination of shape and shading analyses. The system can define shape features that facilitate perception of facial expressions of emotion. The shape features can be second-order statistics of facial landmarks (i.e., distances and angles between landmark points in the face image). The features can alternatively be called configural features, because the features define the configuration of the face. It is appreciated that the terms may be used interchangeable in this application.

FIG. 2(a) shows examples of normalized face landmarks Ŝ_(ij) (i=1, . . . , 66) used by the proposed algorithm, several (e.g., fifteen) of the landmarks can correspond to anatomical landmarks (e.g., corners of the eyes, mouth, eyebrows, tip of the nose, and chin). Other landmarks can be pseudo-landmarks defining the edge of the eyelids, mouth, brows, lips and jaw line as well as the midline of the nose going from the tip of the nose to the horizontal line given by the center of the two eyes. The number of pseudo-landmarks defining the contour of each facial component (e.g., brows) is constant, which provides equivalency of landmark position for different faces or people.

FIG. 2(b) shows a Delaunay triangulation performed by the system. In this example, the number of triangles in this configuration is 107. Also shown in the image are the angles of the vector θ_(a)=(θ_(a1), . . . , θ_(aqa))^(T) (with q_(a)=3), which define the angles of the triangles emanating from the normalized landmark Ŝ_(ija).

S_(ij)=(s_(ij1) ^(T), . . . , s_(ijp) ^(T)) can be a vector of landmark points in the j^(th) sample image (j=1, . . . , n_(i)) of AU i, where s_(ijk) ∈R ² are the 2D image coordinates of the k^(th) landmark, and n_(i) is the number of sample images with AU i present. In some embodiments, the face landmarks can be obtained with computer vision algorithms. For example, the computer vision algorithms can be used to automatically detect any number of landmarks (for example 66 detected landmarks in a test image) as shown in FIG. 2a , where s_(ijk) ∈R ¹³² when the number of landmark points is 66.

The training images can be normalized to have the same inter-eye distance of τ pixels. Specifically, s_(ijk)=c s_(ij), where c=τ/∥1−r∥₂, l, and r are the image coordinates of the center of the left and right eye, ∥.∥₂ defines the 2-norm of a vector, ŝ_(ij)=(ŝ_(ij1) ^(T), . . . , ŝ_(ijp) ^(T)) and τ=300. The location of the center of each eye can be readily computed as the geometric mid-point between the landmarks defining the two corners of the eye.

The shape feature vector of configural features can be defined as,

x _(ij)=(d _(ij12) , . . . ,d _(ijp−1p),θ₁ ^(T), . . . , θ_(p) ^(T))^(T)  (Eqn. 1)

where d_(ijab)=∥ŝ_(ija) ^(T)−ŝ_(ijb) ^(T)∥₂ are the Euclidean distances between normalized landmarks, a=1, . . . , p−1, b=a+1, p and θ_(a)=(θ_(a1), . . . , θ_(aqa))^(T) are the angles defined by each of the Delaunay triangles emanating from the normalized landmark ŝ_(ijj), with q_(a) the number of Delaunay triangles originating at ŝ_(ija) and Σ_(k=1) ^(q) ^(a) θ_(ak)≤360° (the equality holds for non-boundary landmark points). Since each triangle in this figure can be defined by three angles and in this example, there are 107 triangles, the total number of angles in our shape feature vector is 321. The shape feature vectors can be

${x_{ij} \in R^{\frac{p({p - 1})}{2} + {3t}}},$

where p is the number of landmarks and t the number of triangles in the Delaunay triangulation. In this example, with p=66 and t=107, vectors x_(ij) ∈R ^(2,466).

The system can employ Gabor filters that are centered at each of the normalized landmark points ŝ_(ijk) to model shading changes due to the local deformation of the skin. When a facial muscle group deforms the skin of the face locally, the reflectance properties of the skin change (e.g. the skin's bidirectional reflectance distribution function is defined as a function of the skin's wrinkles because this changes the way light penetrates and travels between the epidermis and the dermis and may also vary hemoglobin levels) as well as foreshortening the light source as seen from a point on the surface of the skin.

Cells in early visual cortex in humans can be modelled by the system using the Gabor filters. Face perception can use Gabor-like modeling to gain invariance to shading changes such as those seen when expressing emotions. It can be defined as

$\begin{matrix} {{{g\left( {{{\hat{s}}_{ijk};\lambda},\alpha,\varphi,\gamma} \right)} = {{\exp\left( \frac{s_{1}^{2} + {\gamma^{2}s_{2}^{2}}}{2\sigma^{2}} \right)}\cos\left( {{2\pi\frac{s_{1}}{\lambda}} + \varphi} \right)}},} & (2) \end{matrix}$

with ŝ_(ijk)=(ŝ_(ijk1), ŝ_(ijk2))^(T), s₁=ŝ_(ijk1) cos α+ŝ_(ijk2) sin α, s₂=−ŝ_(ijk1) sin α+ŝ_(ijk2) cos α, λ the wavelength (i.e., number of cycles/pixel), α the orientation (i.e., the angle of the normal vector of the sinusoidal function), φ the phase (i.e., the offset of the sinusoidal function), γ the (spatial) aspect ratio, and σ the scale of the filter (i.e., the standard deviation of the Gaussian window).

In some embodiments, a Gabor filter bank can be used with o orientations, s spatial scales, and r phases. In an example Gabor filter, the following are set: λ={4.4√{square root over (2)},4×2, 4(2√{square root over (2)}), 4(2×2)}={4,4√{square root over (2)}, 8, 8√{square root over (2)}, 16} and γ=1. The values are appropriate to represent facial expressions of emotion. The values of o, s, and r are learned using cross-validation on the training set. The following set are possible values α={4,6,8,10}, σ={λ/4, λ2, 3λ4, λ} and φ={0,1,2} and use 5-fold cross-validation on the training set to determine which set of parameters best discriminates each AU in our face space.

I_(ij) is the j^(th) sample image with AU i present and defined as

g _(ijk)=(g(ŝ _(ijk);λ₁,α₁,φ₁,γ)*I _(ij), . . . ,  (3)

(g(ŝ _(ijk1);λ₅,α^(o),φ_(r),γ)*Iij)^(T),

as the feature vector of Gabor responses at the k^(th) landmark points, where * defines the convolution of the filter g(.) with the image I_(ij) and λ_(k) is the k^(th) element of the set λ defined above, the same applies to α_(k) and φ_(k), but not to γ since this is generally 1.

The feature vector of the Gabor responses on all landmark points for the j^(th) sample image with AU i active are defined as:

g ^(ij)=(g _(ij1) ^(T) , . . . ,g _(ijp) ^(T))  (4)

The feature vectors define the shading information of the local patches around the landmarks of the face and their dimensionality is g_(ij)∈R^(5×p×o×s×r).

The final feature vectors defining the shape and shading changes of AU i in face space are defined as

z _(ij)=(x _(ij) ^(T) ,g _(ij) ^(T))^(T) , j=1, . . . ,n _(i).  (5)

Classification in Face Space for AU and Intensity Recognition

The system can define the training set of AU i as

D _(i)={(z _(i1) ,y _(i1)), . . . ,(z _(in) _(i) ,y _(in) _(i) ),z _(in) _(i) ₊₁ ,y _(in) _(i) ₊₁), . . . ,(z _(in) _(i) _(+m) _(i) ,y _(in) _(i) _(+m) _(i) ))}  (6)

where y_(ij)=1 for j=1, . . . , n_(i), indicating that AU i is present in the image, y_(ij)=0 for j=n_(i)+1, . . . , n_(i)+m_(i), indicating that AU i is not present in the image, and m, is the number of sample images that do not have AU i active.

The training set above is also ordered as follows. The set

D _(i)(a)={(z _(i1) ,y _(i1)), . . . ,(z _(in) _(ia) ,y _(in) _(ia) )}  (7)

includes the n_(ia) samples with AU i active at intensity a (that is the lowest intensity of activation of an AU), the set

_(i)(b)={(z _(in) _(ia) ₊₁ ,y _(in) _(ia) ₊₁), . . . ,(z _(in) _(ia) _(+n) _(ib) ,y _(in) _(ia) _(+n) _(ib) )}  (8)

are the n_(ib) samples with AU i active at intensity b (which is the second smallest intensity).

The set:

_(i)(c)={(z _(in) _(ia) _(+n) _(ib) ₊₁ ,y _(in) _(ia) _(+n) _(ib) ₊₁), . . . ,(z _(in) _(ia) _(+n) _(ib) _(+n) _(ic) ,y _(in) _(ia) _(+n) _(ib) _(+n) _(ic) )}  (9)

are the n_(ic) samples with AU i active at intensity c (which is the next intensity).

The set:

_(i)(d)={(z _(in) _(ia) _(+n) _(ib) _(+n) _(ic) ₊₁ ,y _(in) _(ia) _(+n) _(ib) _(+n) _(ic) ₊₁), . . . ,(z _(in) _(ia) _(+n) _(ib) _(+n) _(ic) _(+n) _(id) ,y _(in) _(ia) _(+n) _(ib) _(+n) _(ic) _(+n) _(id) )}  (10)

are the n_(id) samples with AU i active at intensity d (which is the highest intensity), and n_(ia)+n_(ib)+n_(ic)+n_(id)=n_(i).

An AU can be active at five intensities, which can be labeled a, b, c, d, or e. In some embodiments, there are rare examples with intensity e and, hence, in some embodiments, the four other intensities are sufficient. Otherwise, D_(i)(e) defines the fifth intensity.

The four training sets defined above are subsets of D, and can be represented as different subclasses of the set of images with AU i active. In some embodiments, a subclass-based classifier can be used. In some embodiments, the system utilizes Kernel Subclass Discriminant Analysis (KSDA) to derive instant processes. KSDA can be used because it can uncover complex non-linear classification boundaries by optimizing the kernel matrix and number of subclasses. The KSDA can optimize a class discriminant criterion to separate classes optimally. The criterion is formally given by Q_(i)(ϕ_(i),h_(i1),h_(i2))=Q_(i1)(ϕ_(i),h_(i1),h_(i2))Q_(i2)(ϕ_(i),h_(i1),h_(i2)), with Q_(i1)(ϕ_(i),h_(i1),h_(i2)) responsible for maximizing homoscedasticity. The goal of the kernel map is to find a kernel space F where the data is linearly separable, in some embodiments, the subclasses can be linearly separable in F, which is the case when the class distributions share the same variance, and Q_(i2)(ϕ_(i),h_(i1),h_(i2)) maximizes the distance between all subclass means (i.e., which is used to find the Bayes classifier with smallest Bayes error).

To see this recall that the Bayes classification boundary is given in a location of feature space where the probabilities of the two Normal distributions are identical (i.e., p(z|N(μ₁,Σ₁))=p(z|N(μ₂,Σ₂)), where N(μ_(i),Σ_(i)) is a Normal distribution with mean μ_(i) and covariance matrix Σ_(i). Separating the means of two Normal distributions decreases the value where this equality holds, i.e., the equality p(x|N(μ₁,Σ₁))=p(x|N(μ₂,Σ₂)) is given at a probability values lower than before and, hence, the Bayes error is reduced.

Thus, the first component of the KSDA criterion presented above is given by,

$\begin{matrix} {{Q_{i1}\left( {\varphi_{i},h_{i1},h_{i2}} \right)} = {\frac{1}{h_{i1}h_{i2}}{\sum\limits_{c = 1}^{h_{i1}}{\sum\limits_{d = h_{i1}}^{h_{i1}h_{i2}}\frac{{tr}\left( {\sum\limits_{ic}^{{\varphi}_{i}}\sum\limits_{id}^{{\varphi}_{i}}} \right)}{{{tr}\left( \sum\limits_{ic}^{{\varphi}_{i}^{2}} \right)}{{tr}\left( \sum\limits_{id}^{{\varphi}_{i}^{2}} \right)}}}}}} & (11) \end{matrix}$

where Σ_(i1) ^(φi) is the subclass covariance matrix (i.e., the covariance matrix of the samples in subclass l) in the kernel space defined by the mapping function φ_(i)(.):R^(e)→F, h_(i1) is the number of subclasses representing AU i is present in the image, h_(i2) is the number of subclasses representing AU i is not present in the image, and recall e=3t+p(p−1)/2+5×p×o×s×r is the dimensionality of the feature vectors in the face space defined in Section relating to Face Space.

The second component of the KSDA criterion is,

$\begin{matrix} {{{Q_{i2}\left( {\varphi_{i},h_{i1},h_{i2}} \right)} = {\sum\limits_{c = 1}^{h_{i1}}{\sum\limits_{d = {h_{i1} + 1}}^{h_{i1} + h_{i2}}{p_{ic}p_{id}{{\mu_{ic}^{\varphi_{i}} - \mu_{id}^{\varphi_{i}}}}_{2}^{2}}}}},} & (12) \end{matrix}$

where p_(il)=n_(l)/n_(i) is the prior of subclass l in class i (i.e., the class defining AU i), n_(l) is the number of samples in subclass l, and μ_(il) ^(φi) is the sample mean of subclass l in class i in the kernel space defined by the mapping function φ_(i)(.).

For example, the system can define the mapping functions ϕ_(i)(.) using the Radial Basis Function (RBF) kernel,

$\begin{matrix} {{{k\left( {{z_{ij}\text{?}},{z_{ij}\text{?}}} \right)} = {\exp\left( {- \frac{{{{z_{ij}\text{?}} - z_{{ij}\text{?}}}}_{2}^{2}}{\upsilon_{i}}} \right)}}{\text{?}\text{indicates text missing or illegible when filed}}} & (13) \end{matrix}$

where v_(i) is the variance of the RBF, and j₁,j₂=1, . . . , n_(i)+m_(i). Hence, the instant KSDA-based classifier is given by the solution to:

$\begin{matrix} {{\upsilon_{i}^{*},h_{i1}^{*},{h_{i2}^{*} = {\arg\underset{\upsilon,h_{i1},h_{i2}}{\max\text{?}}{Q_{i}\left( {\upsilon_{i},h_{i1},h_{i2}} \right)}}}}{\text{?}\text{indicates text missing or illegible when filed}}} & (14) \end{matrix}$

FIG. 3 depicts a solution of the above equation to yield a model for AU i. In the hypothetical model shown above, the sample images with AU 4 active are first divided into four subclasses, with each subclass including the samples of AU 4 at the same intensity of activation (a-e). Then, the derived KSDA-based approach uses a process to further subdivide each subclass into additional subclasses to find the kernel mapping that intrinsically maps the data into a kernel space where the above Normal distributions can be separated linearly and are as far apart from each other as possible.

To do this, the system divides the training set D_(i) into five subclasses. The first subclass (i.e., l=1) includes the sample feature vectors that correspond to the images with AU i active at intensity a, that is, the D_(i)(a) defined in S. Du, Y. Tao, and A. M. Martinez, “Compound facial expressions of emotion” Proceedings of the National Academy of Sciences, 111(15):E1454-E1462, 2014, which is incorporated by reference herein in its entirety. The second subclass (l=2) includes the sample subset. Similarly, the third and fourth subclass (l=2, 3) include the sample subsets, respectively. Finally, the five subclass (l=5) includes the sample feature vectors corresponding to the images with AU i not active, i.e.,

_(i)(not active)={(z _(in) _(i) ,y _(in) _(i) ), . . . ,(z _(in) _(i) _(+m) _(i) ,y _(in) _(i) _(+m) _(i) )}.  (15)

Thus, initially, the number of subclasses to define AU i active/inactive is five (i.e., h_(i1)=4 and h_(i2)=1). In some embodiments, this number can be larger; for example, if images at intensity e are considered.

Optimizing Equation 14 may yield additional subclasses. The derived approach optimizes the parameter of the kernel map v_(i) as well as the number of subclasses h_(ij) and h_(i2). In this embodiment, the initial (five) subclasses can be further subdivided into additional subclasses. For example, when no kernel parameter v_(i) can map the non-linearly separable samples in D_(i)(a) into a space where these are linearly separable from the other subsets, D_(i)(a) is further divided into two subsets D_(i)(a)={D_(i)(a₁),D_(i)(a₂)}. This division is simply given by a nearest-neighbor clustering. Formally, let the sample z_(ij+1) be the nearest-neighbor to z_(ij), then the division of D_(i)(a) is readily given by,

_(i)(a ₁)={(z _(i1) ,y _(i1)), . . . ,(z _(in) _(a) _(/2) ,y _(in) _(a) _(/2))}

_(i)(a ₂)={(z _(in) _(a) _(/2+1) ,y _(in) _(a) _(/2+1)), . . . ,(z _(in) _(a) ,y _(in) _(a) )}  (16)

The same applies to D_(i)(b), D_(i)(c), D_(i)(d), D_(i)(e) and D_(i)(not active). Thus, optimizing Equation 14 can result in multiple subclasses to model the samples of each intensity of activation or non-activation of AU i, e.g., if subclass one (l=1) defines the samples in D_(i)(a) and the system divides this into two subclasses (and currently h_(i1)=4), then the first new two subclasses will be used to define the samples in D_(i)(a), with the fist subclass (l=1) including the samples in D_(i)(a₁) and the second subclass (l=2) those in D_(i)(a₂) (and h_(i1) will now be 5). Subsequent subclasses will define the samples in D_(i)(b), D_(i)(c), D_(i)(d), D_(i)(e) and D_(i)(not active) as defined above. Thus, the order of the samples as given in D_(i) never changes with subclasses 1 through h_(i1) defining the sample feature vectors associated to the images with AU i active and subclasses h_(i1)+1 through h_(i1)+h_(i2) those representing the images with AU i not active. This end result is illustrated using a hypothetical example in FIG. 3.

In one example, every test image in a set of images I_(test) can be classified. First, I_(test) includes a feature representation in face space vector z_(test) that is computed in relation to Face Space as described above. Second, the vector is projected into the kernel space and called z^(φ) _(test). To determine if this image has AU i active, the system computes the nearest mean,

$\begin{matrix} {{{j^{*} = {\arg\min\limits_{i}{{{z_{test}\text{?}} - {\mu_{ij}^{\varphi}\text{?}}}}_{2}}},{j = 1},\ldots,{h_{i1} + h_{i2}}}{\text{?}\text{indicates text missing or illegible when filed}}} & (17) \end{matrix}$

If j*≤h_(i1), then I_(test) is labeled as having AU i active; otherwise, it is not.

The classification result provides intensity recognition. If the samples represented by subclass l are a subset of those in D_(i)(a), then the identified intensity is a. Similarly, if the samples of subclass l are a subset of those in D_(i)(b), D_(i)(c), D_(i)(d) or D_(i)(e), then the intensity of AU i in the test image I_(test) is b, c, d and e, respectively. Of course, if j*>h_(i1), the images does not have AU i present and there is no intensity (or, one could say that the intensity is zero).

FIG. 4 illustrates an example component diagram of a system 400 to perform the functions described above with respect to FIGS. 1-3. The system 400 includes an image database component 410 having a set of images. The system 400 includes detector 420 to eliminate non-face images in the image database. Creates a subset of the set of images of images only including faces. The system 400 includes a training database 430. The training database 430 is utilized by a classifier component 440 to classify images into an emotion category. The system 400 includes a tagging component 450 that tags the images with at least one AU and an emotion category. The system 400 can store the tagged images in a processed image database 460.

Discriminant Functional Learning of Color Features for the Recognition of Facial Action Units

In another aspect, a system facilitates comprehensive computer vision processes for the identification of AUs using facial color features. Color features can be used to recognize AUs and Au intensities. The functions defining color change as an AU goes from inactive to active or vice-versa are consistent within AUs and the differentials between them. In addition, the system reveals how facial color changes can be exploited to identify the presence of AUs in videos filmed under a large variety of image conditions and externally of image database.

The system receives an i^(th) sample video sequence V_(i)={I_(i1), . . . , I_(ir) _(i) }, where r_(i) is the number of frames and I_(ik)∈R^(3qw) is the vectorized k^(th) color image of q×w RGB pixels. V_(i) can be described as the sample function ƒ_(i)(t).

The system identifies a set of physical facial landmarks on the face and obtains local face regions using algorithms described herein. The system defines the landmark points in vector form as s_(ik)=(s_(ik1), . . . , s_(ik66)), where i is the sample video index, k the frame number, and s_(ik1)∈R² are the 2D image coordinates of the l^(th) landmark, l=1, . . . , 66. For purposes of explanation, specific example values may be used (e.g. 66 landmarks, 107 image patches) in this description. It is appreciated that the values may vary according to image sets, faces, landmarks, and/or the like.

The system defines a set D_(ij)={d_(i1k), . . . , d_(i107k)} as a set of 107 image patches d_(ijk) obtained with a Delaunay triangulation as described above, where d_(ijk)∈R^(3q) _(ij) is the vector describing the j^(th) triangular local region of q_(ij) RGB pixels and, as above, i specifies the sample video number (i=1, . . . , n) and k the frame (k=1, . . . , r_(i)).

In some embodiments, the size (i.e., number of pixels, q_(ij)) of these local (triangular) regions not only vanes across individuals but also within a video sequence of the same person. This is a result of the movement of the facial landmark points, a necessary process to produce a facial expression. The system defines a feature space that is invariant to the number of pixels in each of these local regions. The system computes statistics on the color of the pixels in each local region as follows.

The system computes the first and second (central) moments of the color of each local region,

$\begin{matrix} {{\mu_{ijk} = {q_{ij}^{- 1}{\sum\limits_{p = 1}^{p}d_{ijkp}}}}{{\sigma_{ijk} = \sqrt{q_{ij}^{- 1}{\sum\limits_{p = 1}^{p}\left( {d_{ijkp} - \mu_{ijk}} \right)^{2}}}},}} & (18) \end{matrix}$

with d_(ijk)=(d_(ijk1), . . . , d_(ijkP))^(T) and μ_(ijk), σ_(ijk)∈R³. In some embodiments, additional moments are computed.

The color feature vector of each local patch can be defined as

x _(ij)=(μ_(ij1), . . . ,μ_(ijr) _(i) ,σ_(ij1), . . . ,σ_(ijr) _(i) )^(T),  (19)

where, i is the sample video index (V_(i)), j the local patch number and r_(i) the number of frames in this video sequence. This feature representation defines the contribution of color in patch j. In some embodiments, other proven features can be included to increase richness of the feature representation. For example, responses to filters or shape features.

Invariant Functional Representation of Color

The system can define the above computed color information as a function invariant to time, i.e., the functional representation is consistent regardless of where in the video sequence an AU becomes active.

The color function ƒ(.) that defines color variations of a video sequence V, and a template function ƒ_(T)(.) that models the color changes associated with the activation of an AU (i.e., from AU inactive to active). The system determines if ƒ_(T)(.) is in ƒ(.).

In some embodiments, the system determines this by placing the template function ƒ_(T)(.) at each possible location in the time domain of ƒ(.). This is typically called a sliding-window approach, because it involves sliding a window left and right until all possible positions of ƒ_(T)(.) have been checked.

In other embodiments, the system derives a method using a Gabor transform. The Gabor transform is designed to determine the frequency and phase content of a local section of a function to derive an algorithm to find the matching of ƒ_(T)(.) in ƒ(.) without using a sliding-window search.

In this embodiment, without loss of generality, ƒ(t) can be a function describing one of the color descriptors, e.g., the mean of the red channel in the j^(th) triangle of video i or the first channel in an opponent color representation. Then, the Gabor transform of this function is

G(t,f)=∫_(−∞) ^(∞)ƒ(τ)g(τ−t)e ^(−2πjƒτ) dτ,  (20)

where g(t) is a concave function and

=√{square root over (−1)}. One possible pulse function may be defined as

$\begin{matrix} {{g(t)} = \left\{ {\begin{matrix} {1,} & {0 \leq t \leq L} \\ {0,} & {otherwise} \end{matrix},} \right.} & (21) \end{matrix}$

where L is a fixed time length. Other pulse functions might be used in other embodiments. Using the two equations yields

$\begin{matrix} {{G\left( {t,f} \right)} = {{\int_{t - L}^{t}{{f(\tau)}e^{{- 2}\pi}\text{?}\, d\tau}} = {e^{{- 2}\pi}\text{?}{\int_{0}^{L}{{f\left( {\tau + t - L} \right)}\, e^{{- 2}\pi}\text{?}d{\tau.\text{?}}\text{indicates text missing or illegible when filed}}}}}} & (22) \end{matrix}$

as the definition of a functional inner product in the timespan [0, L] and, thus, G(.,.) can be written as

G(t,f)=e ^(−2πjƒ(t−L))(ƒ(τ+t−L),e ^(−2jπƒτ)),  (23)

where <., .> is the functional inner product. The Gabor transform above is continuous in time and frequency, in the noise-free case.

To compute the color descriptor of the i^(th) video, ƒ_(i1)(t), all functions are defined in a color space spanned by a set of b basis functions ϕ(t)={ϕ₀(t), . . . , ϕ_(b−1)(t)}, with ƒ_(i) ₁ (t)=Σ_(c=0) ^(b−1)c₁ ₁ _(z)ϕ_(z)(t) and c₁ ₁ =(c_(i) ₁ ₀, . . . , c_(i) ₁ _(b−1))^(T) as the vector of coefficients. The functional inner product of two color descriptors can be defined as

$\begin{matrix} {{\left\langle {{f_{i_{1}}\left( \text{?} \right)},{f_{i_{2}}\left( \text{?} \right)}} \right\rangle = {{\sum\limits_{\forall}{\text{?}{\int_{0}^{L}{c_{i_{1}r}\phi_{i}\text{?}(t)c\text{?}{\phi_{i_{2}}\left( \text{?} \right)}{dt}}}}} = {c_{i}^{T}\text{?}{\Phi(t)}c_{i_{2}}\text{?}}}}{\text{?}\text{indicates text missing or illegible when filed}}} & (24) \end{matrix}$

where Φ is a b×b matrix with elements Φ_(ij)=(ϕ_(i)(t), ϕ_(j)(t)).

In some embodiments, the model assumes that statistical color properties change smoothly over time and that their effect in muscle activation has a maximum time span of L seconds. The basis functions that fit this description are the first several components of the real part of the Fourier series, i.e., normalized cosine basis. Other basis functions can be used in other embodiments.

Cosine bases can be defined as ψ_(z)(t)=cos(2πzt), z=0, . . . , b−1. The corresponding normalized bases are defined as

$\begin{matrix} {{{\hat{\psi}}_{z}(t)} = {\frac{\psi_{z}(t)}{\sqrt{\left\langle {{\psi_{z}(t)},{\psi_{z}(t)}} \right\rangle}}.}} & (25) \end{matrix}$

The normalized basis set allows Φ=Id_(b), where Id_(b) denotes the b×b identity matrix, rather than an arbitrary positive definite matrix.

The above derivations with the cosine bases makes the frequency space implicitly discrete. The Gabor transform {tilde over (G)}(.,.) of color functions becomes

{tilde over (G)}(t,z)=

{tilde over (ƒ)}_(i) ₁ (t),{circumflex over (ψ)}_(z)(t)

=c _(i) ₁ _(z) , z=0, . . . ,b−1,  (26)

where ƒ _(i1)(t) is the computed function ƒ_(i1)(t) in the interval [t−L, t] and c_(i1z) is the z^(th) coefficient.

It is appreciated that the above-derived system does not include the time domain, however, the time domain coefficients can be found and utilized, where needed.

Functional Classifier of Action Units

The system employs the Gabor transform derived above to define a feature space invariant to the timing and duration of an AU. In the resulting space, the system employs a linear or non-linear classifier. In some embodiment, a KSDA, a Support Vector Machine (SVM) or a Deep multilayer neural Network (DN) may be used as classifier.

Functional Color Space

The system includes functions describing the mean and standard deviation of color information from distinct local patches, which uses simultaneous modeling of multiple functions described below.

The system defines a multidimensional function Γ_(i)(t)=(γ_(i) ¹(t), . . . , γ_(i) ²(t))^(T), with each function γ_(z)(t) the mean or standard deviation of a color channel in a given patch. Using the basis expansion approach, each γ_(i) ^(e)(t) is defined by a set of coefficients c_(ie) and, thus, Γ_(i)(t) is given by:

c _(i) ^(T)=[(c _(i) ¹)^(T), . . . ,(c _(i) ^(g))^(T)].  (27)

The inner product for multidimensional functions is redefined using normalized Fourier cosine bases to achieve

$\begin{matrix} {\left\langle {{\Gamma_{i}(t)},{\Gamma_{j}(t)}} \right\rangle = {{\sum{\text{?}\left\langle {{\gamma\text{?}(t)},{\gamma\text{?}(t)}} \right\rangle}} = {{\sum\limits_{e = 1}^{g}{\left( {c_{i}\text{?}} \right)^{T}c_{j}\text{?}}} = {c_{i}^{T}{c_{j}.\text{?}}\text{indicates text missing or illegible when filed}}}}} & (28) \end{matrix}$

Other bases can be used in other embodiments.

The system uses a training set of video sequences to optimize each classifier. It is important to note that the system is invariant to the length (i.e., number of frames) of a video. Hence, the system does not use alignment or cropping of the videos for recognition.

In some embodiments, the system can be extended to identify AU intensity using the above approach and a multi-class classifier. The system can be trained to detect AU and each of the five intensities, a, b, c, d, and e and AU inactive (not present). The system can also be trained to identify emotion categories in images of facial expressions using the same approach described above.

In some embodiments, the system can detect AUs and emotion categories in videos. In other embodiments, the system can identify AUs in still images. To identify AUs in still images, the system first learns to compute the functional color features defined above from a single image with regression. In this embodiment, the system regresses a function h(x)=y to map an input image x into the required functional representation of color y.

Support Vector Machines

A training set is defined {(γ₁(t),y₁), . . . , (γ_(n)(t),y_(n))}, where γ_(i)(t)∈H^(v), H^(v) is a Hilbert space of continuous functions with bounded derivatives up to order v, and y_(i)∈{−1, 1} are their class labels, with +1 indicating that the AU is active and −1 inactive.

When the samples of distinct classes are linearly separable, the function w(t) that maximizes class separability is given by

$\begin{matrix} \begin{matrix} {{J\left( {{\omega(t)},\upsilon,\xi} \right)} =} & {\min\limits_{{\omega(t)},\upsilon,\xi}\left\{ {{\frac{1}{2}\left\langle {{\omega(t)},{\omega(t)}} \right\rangle} + {C{\sum\limits_{i = 1}^{n}\xi_{i}}}} \right\}} \\ {{subject}{to}} & {{{y_{i}\left( {\left\langle {{\omega(t)},{\gamma_{i}(t)}} \right\rangle - \upsilon} \right)} \geq {1 - \xi_{i}}},} \\  & {{\xi_{i} \geq 0},} \end{matrix} & (29) \end{matrix}$

where v is the bias and, as above, <γ_(i)(t),γ_(j)(t)>=∫γ_(i)(t) γ_(j)(t) dt denotes the functional inner product ξ=(ξ₁, . . . , ξ_(n))^(T) are the slack variables, and C>0 is a penalty value found using cross-validation.

Applied to our derived approach to model Γ_(i) using normalized cosine coefficients jointly with (28), transforms (29) to the following criterion

$\begin{matrix} {{J\left( {w,\upsilon,\xi,\alpha} \right)} = {\min\limits_{w,\xi,h,a}{\left\{ {{\frac{1}{2}w^{T}w} + {C{\sum\limits_{i = 1}^{n}\xi_{i}}} - {\sum\limits_{i = 1}^{n}{\alpha_{i}\left( {{y_{i}\left( {{w^{T}c_{i}} - \upsilon} \right)} - 1 + \xi_{i}} \right)}} - {\sum\limits_{i = 1}^{n}{\theta_{i}\xi_{i}}}} \right\}.}}} & (30) \end{matrix}$

where C>0 is a penalty value found using cross-validation.

The system projects the original color spaces onto the first several (e.g., two) principal components of the data. The principal components are given by Principal Components Analysis (PCA). The resulting p dimensions are labeled φ_(PCA) _(k) , k=1, 2, . . . , p.

Once trained, the system can detect AUs, AU intensities and emotion categories in video in real time or faster than real time. In some embodiments, the system can detect AUs at greater than 30 frames/second/CPU thread.

Deep Network Approach Using Multilayer Perceptron

In some embodiments, the system can include a deep network to identify non-linear classifiers in the color feature space.

The system can train a multilayer perceptron network (MPN) using the coefficients c_(i). This deep neural network is composed of several (e.g., 5) blocks of connected layers with batch normalization and some linear or non-linear functional rectification, e.g., rectified linear units (ReLu). To effectively train the network, the system uses data augmentation by super-sampling the minority class (AU active/AU intensity) or down-sampling the majority class (AU not active); the system may also use class weights and weight decay.

We train this neural network using gradient descent. The resulting algorithm works in real time or faster than real time, >30 frames/second/CPU thread.

AU Detection in Still Images

To apply the system to still images, the system specifies color functions f_(i) of image I_(i). That is, the system defines the mapping h(I_(i))=f_(i) where f_(i) is defined by its coefficients c_(i) ^(T). In some embodiments, the coefficients can be learned from training data using non-linear regression.

The system utilizes a training set of m videos, {V₁, . . . , V_(m)}. As above, V_(i)={I_(i1), . . . , I_(ir1)}. The system considers every sub-set of consecutive frames of length L (with L≤r_(i)), i.e., W_(i1)={I_(i1), . . . , I_(iL)}, W_(i2)={I_(i2), . . . , I_(i(L+1))}, . . . , W_(i(ri−L))={I_(i(ri−L)), . . . , I_(iri)}. The system computes the color representations of all W_(ik) as described above. This yields x_(ik)=(x_(i1k), . . . , x_(i107k))^(T) for each W_(ik), k=1, . . . , r_(i)−L. Following (19)

x _(ijk)=(μ_(ij1), . . . ,μ_(ijL),σ_(ij1), . . . ,σ_(ijL))^(T),  (31)

where i and k specify the video W_(ik), and j the patch, j=1, . . . , 107.

The system computes the functional color representations f_(ijk) of each W_(ik) for each of the patches, j=1, . . . , 107. This is done using the approach detailed above to yield f_(ijk)=(c_(ijk1), . . . , c_(ijkQ))^(T), where c_(ijkq) is the q^(th) coefficient of the j patch in video W_(ij). The training set is then given by the pairs {x_(ijk), ƒ_(ijk)}. The training set is used to regress the function ƒ_(ijk)=h(x_(ijk)). For example, let Î be a test image and {circumflex over (x)}_(j) its color representation in patch j. Regression is used to estimate the mapping from image to functional color representation, as defined above. For example, Kernel Ridge Regression can be used to estimate the q^(th) coefficient of the test image as:

ĉ _(jq)=

^(T)(K+λId)⁻¹κ({circumflex over (x)} _(j)),  (32)

where {circumflex over (x)}_(j) is the color feature vector of the j^(th) patch C=(c_(1j1q), . . . , c_(mj(r) _(m) _(−L)q))^(T) is the vector of coefficients of the j^(th) patch in all training images, K is the Kernel matrix, K(i,j)=k(x_(ijk),x_(ijk)) (i and i=1, . . . , m, k and {circumflex over (k)}=1, . . . , r_(i)−L), and κ({circumflex over (x)}_(j))=(k({circumflex over (x)}_(j),x_(1j1)), . . . , k({circumflex over (x)}_(j),x_(mj(r) _(m) _(−L))))^(T). The system can use the Radial Basis Function kernel, k(a, b; η)=exp(−η∥a−b∥²). In some embodiments, the parameters η and λ are selected to maximize accuracy and minimize model complexity. This is the same as optimizing the bias-variance tradeoff. The system uses a solution to the bias-variance problem as known in the art.

As shown above, the system can use a regressor on previously unseen test images. If Î is a previously unseen test image. Its functional representation is readily obtained as ĉ=h({circumflex over (x)}), with ĉ=(c₁₁, . . . , c_(107Q))^(T). This functional color representation can be directly used in the functional classifier derived above.

FIG. 5 illustrates a color variance system 500 for detecting AUs or emotions using color variance in video and/or still images. The system 500 includes an image database component 510 having a set of videos and/or images. The system 500 includes a landmark component 520 that detects landmarks in the image database 510. The landmark component 520 creates a subset of the set of images of images with defined landmarks. The system 500 includes a statistics component 530 that calculates changes in color in a video sequence or statistics in a still image of a face. From the statistics component 530, AUs or emotions are determined for each video or image in the database component 510 as described above. The system 500 includes a tagging component 540 that tags the images with at least one AU or no AU. The system 500 can store the tagged images in a processed image database 550.

Facial Color Used to Recognize Emotion in Images of Facial Expressions and Edit Images of Faces to Make them Appear to Express a Different Emotion

In the methodology described above, the system used configural, shape, shading and color features to identify AUs. This is because, AUs define emotion categories, i.e., a unique combination of AUs, specifies a unique emotion category. Nonetheless, facial color also transmits emotion. Face can express emotion information to observers by changing the blood flow on the network of blood vessels closest to the surface of the skin. Consider, for instance, the redness associated with anger or the paleness in fear. These color patterns are caused by variations in blood flow and can occur even in the absence of muscle activation. Our system detects these color variations, which allows it to identify emotion even in the absence of muscle action (i.e., regardless of whether AUs are present or not in the image).

Areas of the Face.

The system denotes each face color image of p by q pixels as I_(ij)∈

^(p×q×3) and the r landmark points of each of the facial components of the face as s_(ij)=(s_(ij1), . . . s_(ijr))^(T), s_(ilk)∈

² the 2-dimensional coordinates of the landmark point on the image. Here, i specifies the subject and j the emotion category. In some embodiments, the system uses r=66. These fiducial points define the contours of the internal and external components of the face, e.g. mouth, nose, eyes, brows, jawline and crest. Delaunay triangulation can be used to create the triangular local areas defined by these facial landmark points. This triangulation yields a number of local areas (e.g., 142 areas when using 66 landmark points). Let this number be a.

The system can define a function D={d₁, . . . , d_(a)}, as a set of functions that return the pixels of each of these a local regions, i.e., d_(k)(I_(ij)) is a vector including the l pixels within the k^(th) Delaunay triangle in image I_(ij), i.e., d_(k)(I_(ij))=(d_(ijk1), . . . , d_(ijkl))^(T)∈

^(3l), where d_(ijks)∈

³ defines the values of the three color channels of each pixel.

Color Space.

The above derivations divide each face image into a set of local regions. The system can compute color statistics of each of these local regions in each of the images. Specifically, the system computes first and second moments (i.e., mean and variance) of the data, defined as

${\mu_{ijk} = {l^{- 1}{\sum\limits_{s = 1}^{l}d_{ijks}}}}{\sigma_{ijk} = {\sqrt{l^{- 1}{\sum\limits_{s = 1}^{l}\left( {d_{ijks} - \mu_{ijk}} \right)^{2}}}.}}$

In other embodiments, additional moments of the color of the image are utilized Every image I_(ij) is now represented using the following feature vector of color statistics, x_(ij)=(μ_(ij1) ^(T), σ_(ij1) ^(T), . . . , μ_(ij120) ^(T), σ_(ij120) ^(T))^(T)∈

⁷²⁰.

Using the same modeling, the system defines a color feature vector of each neutral face as x_(in)=(μ_(in1) ^(T), σ_(in1) ^(T), . . . , μ_(in120) ^(T), σ_(in120) ^(T))^(T), where n indicates this feature vector corresponds to a neutral expression, not an emotion category. The average neutral face is x _(n)=m⁻¹ Σ_(i=1) ^(m)x_(in), with m the number of identities in the training set. The color representation of a facial expression of emotion is then given by its deviation from this neutral face, {circumflex over (x)}_(ij)=x_(ij)−x _(n).

Classification.

The system uses a linear or non-linear classifier to classify emotion categories in the color space defined above. In some embodiments, Linear Discriminant Analysis (LDA) is computed on the above-defined color space. In some embodiments, the color space can be defined by eigenvectors associated with a non-zero eigenvalues of the matrix Σ_(X) ⁻¹S_(B), where Σ_(X)=Σ_(i=1) ^(m)Σ_(j−1) ¹⁸({circumflex over (x)}_(ij)−μ)({circumflex over (x)}_(ij)−μ)^(T)+δI is the (regularized) covariance matrix, S_(B)=Σ_(j=) ^(C)(x _(j)−μ)(x _(j)−μ)^(T), x _(j)=m⁻¹Σ_(i=1) ^(m){circumflex over (x)}_(ij) are the class means, μ=(18 m)⁻¹Σ_(i=1) ^(m)Σ_(j−1) ¹⁸{circumflex over (x)}_(ij), I is the identity matrix, δ=0.01 the regularizing parameter, and C the number of classes.

In other embodiments, the system can employ Subclass Discriminate Analysis (SDA), KSDA, or Deep Neural Networks.

Multiway Classification

The selected classifier (e.g., LDA) is used to compute the color space (or spaces) of the C emotion categories and neutral. In some embodiments, the system is trained to recognize 23 emotion categories, including basic and compound emotions.

The system divides the available samples into ten different sets S={S₁, . . . , S₁₀}, where each subset S_(t) with the same number of samples. This division is done in a way that the number of samples in each emotion category (plus neutral) is equal in every subset. The system repeats the following procedure with t=1, . . . , 10: All the subsets, except S_(t), are used to compute Σ_(X) and S_(B). The samples in subset S_(t), which were not used to compute the LDA subspace

, are projected onto

. Each of the test sample feature vectors t_(j)∈S_(t) is assigned to the emotion category of the nearest category mean, given by the Euclidean distance, e_(j)*=arg min_(e) (t_(j)−x _(e))^(T)(t_(j)−x _(e)). The classification accuracy over all the test samples t_(j)∈S_(t) is given by

μ_(t^(th) − fold) = n_(t)⁻¹Σ_(∀x_(j) ∈ S_(t))1_({e_(j)^(*) = y(t_(j))}),

where n_(t) is the number of samples in S_(t), y(t_(j)) is the oracle function that returns the true emotion category of sample t_(j), and

1_({e_(j)^(*) = y(t_(j))})

is the zero-one loss which equals one when e_(j)*=y(t_(j)) and zero elsewhere. Thus, S_(t) serves as the testing subset to determine the generalization of our color model. Since t=1, . . . , 10, the system can repeat this procedure ten times, each time leaving one of the subsets S_(t) out for testing, and then compute the mean classification accuracy as, μ_(10-fold=)0.1Σ_(t=1) ¹⁰μ_(t) _(th) _(10-fold). The standard deviation of the cross-validated classification accuracies is σ_(10-fold)=√{square root over (0.1Σ_(t=1) ¹⁰(μ_(t) _(th) _(10-fold)−σ_(10-fold))²)}. This process allows the system to identify the discriminant color features with best generalizations, i.e., those that apply to images not included in the training set.

In other embodiments, the system uses a 2-way (one versus all) classifier.

One-Versus-all Classification:

The system identifies the most discriminant color features of each emotion category by repeating the approach described above C times, each time assigning the samples of one emotion category (i.e., emotion category c) to class 1 (i.e., the emotion under study) and the samples of all other emotion categories to class 2. Formally, S_(c)={∀t_(j)|y(t_(j))=c} and S _(c)={∀t_(j)|y(t_(j))≠c}, with c=(1, . . . , C).

A linear or no-linear classifier (e.g., KSDA) is used to discriminate the samples in S_(c) from those in S _(c).

Ten-fold cross-validation: The system uses the same 10-fold cross-validation procedure and nearest-mean classifier described above.

In some embodiments, to avoid biases due to the sample imbalance in this two class problem, the system can apply downsampling on S _(c). In some cases, the system repeat this procedure a number of times, each time drawing a random sample from S _(c) to match the number of samples in S_(c).

Discriminant Color Model:

When using LDA as the 2-way classifier, Σ_(X) ⁻¹S_(B)V=VΛprovides the set of discriminant vectors V=(v₁ ^(T), . . . , v_(b) ^(T)), ordered from most discriminant to least discriminant, λ₁>λ₂= . . . =λ_(b)=0, where Λ=diag(λ₁, λ₂, . . . λ_(b)). The discriminant vector v₁=(v_(1,1), . . . , v_(1,720)) defines the contributions of each color feature in discriminating the emotion category. The system may only keep the v₁ since this is the only basis vector associated to a non-zero eigenvalues, λ₁>0. The color model of emotion j is thus given by {tilde over (x)}_(j)=v₁ ^(T) x _(j). Similarly, {tilde over (x)}_(n)=v₁ ^(T) x _(n).

Similar results are obtained when using SDA, KSDA, Deep Networks and other classifiers.

Modifying Image Color to Change the Apparent Emotion Expressed by a Face.

The neutral expressions, I_(in) can be modified by the system to appear to express an emotion. These can be called modified images Ĩ_(ij), where i specifies the image or individual in the image, and j the emotion category. Ĩ_(ij) corresponds to the modified color feature vectors y_(ij)=x_(in)+α({tilde over (x)}_(j)−{tilde over (x)}_(n)), with α>1. In some embodiments, to create these images, the system modifies the k^(th) pixel of the neutral image using the color model of emotion j as follows:

I ~ ijk = ( I ink - w g g ) ⁢ ( g + β g ) + ( w g ⁢ β ⁢ w ~ g ) ,

where I_(ink) is the k^(th) pixel of the neutral image I_(in), I_(ink)∈d_(g)(I_(in)), w_(g) and

_(g) are the mean and standard deviation of the color of the pixels in the g^(th) Delaunay triangle, and {tilde over (w)}_(g) and

are the mean and standard deviation of the color of the pixels in d_(g) as given by the new model y_(ij).

In some embodiments, the system smooths the modified images with a r by r Gaussian filter with variance σ. The smoothing eliminates local shading and shape features, forcing people to focus on the color of the face and making the emotion category more apparent.

In some embodiments, the system modifies images of facial expressions of emotion to decrease or increase the appearance of the expressed emotion. To decrease the appearance of the emotion j, the system can eliminate the color pattern associated to emotion j to obtain the resulting image I_(ij) ⁻. The images are computed as above using the associated feature vectors z_(ij) ⁻=x_(ij)−β({tilde over (x)}_(j)−{tilde over (x)}_(n)), i=1, . . . 184, j=1, . . . 18, β>1.

To increase the perception of the emotion, the system defines the new color feature vectors as z_(ij) ⁺=x_(ij)+α({tilde over (x)}_(j)−{tilde over (x)}_(n)), i=1, . . . 184, j=1, . . . 18, α>1 to obtain resulting images I_(ij) ⁺.

FIG. 6 illustrates the color variance system 500 for detecting AUs or emotions using color variance in video and/or still images. The system 600 includes an image database component 610 having a set of videos and/or images. The system 600 includes a landmark component 620 that detects landmarks in the image database 610. The landmark component 620 creates a subset of the set of images of images with defined landmarks. The system 600 includes a statistics component 630 that calculates changes in color in a video sequence or statistics in a still image of a face. From the statistics component 630, AUs or emotions are determined for each video or image in the database component 610 as described above. The system 600 includes a tagging component 640 that tags the images with at least one AU or no AU. The system 600 can store the tagged images in a processed image database 650.

The system 600 includes a modification component 660 that can change perceived emotions in an image. In some embodiments, after the system 600 determines a neutral face in an image the modification component 660 modifies the color of the image of the neutral face to yield or change the appearance of a determined expression of an emotion or an AU. For example, an image is determined to include a neutral expression. The modification component 660 can alter the color in the image to change the expression to perceive a predetermined expression such as happy or sad.

In other embodiments, after the system 600 determines an emotion or AU in a face in an image, the modification component 660 modifies the color of the image to increase or decrease the intensity of the emotion or AU to change the perception of the emotion or the AU. For example, an image is determined to include a sad expression. The modification component 660 can alter the color in the image to make the expression be perceived as less or more sad.

Global-Local Fitting in DNNs for Fast and Accurate Detection and Recognition of Facial Landmark Points and Action Units

In another aspect, a Global-Local loss function for Deep Neural Networks (DNNs) is presented that can be efficiently used in fine-grained detection of similar object landmark points (e.g., facial landmark points) of interest as well as fine-grained recognition of object attributes, e.g., AUs. The derived local+global loss yields accurate local results without the need to use patch-based approaches and results in fast and desirable convergences. The instant Global-Local loss function may be used for the recognition of AUs or detecting faces and facial landmark points necessary for the recognition of AUs and facial expressions.

Global-Local Loss

Derivations of a global-local (GL) loss that can be efficiently used in deep networks for detection and recognition in images. A system can use this loss to train a deep DNN to recognize AUs. The system uses a portion of the DNN to detect facial landmark points. These detections are concatenated with the output of the fully connected layer of the other components of the network to detect AUs.

Local Fit

The system defines image samples and corresponding output variables as the set {(I₁,y₁), . . . , (I_(n),y_(n))}, where I_(i)∈R^(l×m) is a l×m-pixel image of a face, y_(i) is the true (desirable) output, and n is the number of samples.

In some embodiments, the output variable y_(i) can be in various forms. For example, in the detection of 2D object landmark points in images, y_(i) is a vector of p 2D image coordinates y_(i)=(u_(i1), v_(i1), . . . , u_(ip), v_(ip))^(T), (u_(ij), v_(ij))^(T) the j^(th) landmark points. In the recognition of AUs, the output variable corresponds to an indicator vector y_(i)=(y_(i1), . . . , y_(iq))T, with y_(ij)=1 if AU j is present in image I_(i) and y_(ij)=−1 when AU j is not present in that image.

The system identifies a vector of mapping functions ƒ(I_(i),w)=(ƒ₁(I_(i),w₁), . . . , ƒ_(r)(I_(i),w_(r)))^(T) that converts the input image I_(i) to an output vector y_(i) of detections or attributes, and w=(w₁, . . . , w_(r))^(T) is the vector of parameters of these mapping functions. Note that r=p and ƒ(.)=(û_(i1), {circumflex over (v)}_(i1), . . . , û_(ip), {circumflex over (v)}_(ip))^(T) in detection, here with ƒ_(i)(I_(i), w_(j))=(û_(ij), {circumflex over (v)}_(ij))^(T) as the estimates of the 2D image coordinates u_(ij) and v_(ij). Similarly, r=g and f(.)=(ŷ_(i1), . . . , ŷ_(iq))^(T) in the recognition of AUs, where ŷ_(ij) is the estimate of whether AU j is present (1) or not (−1) in image I_(i), and g is the number of AUs.

For a fixed mapping function f(I_(i), w)(e.g., a DNN), the system optimizes w, defined as

$\begin{matrix} {{{\mathcal{J}\left( \overset{\sim}{w} \right)} = {\min\limits_{w}{\mathcal{L}_{local}\left( {{f\left( {I_{i},w} \right)},y_{i}} \right)}}},} & (33) \end{matrix}$

where

_(local)(.) denotes the loss function. A classical solution for this loss function is the L²-loss, defined as,

$\begin{matrix} {{{\mathcal{L}_{local}\left( {{f\left( {I_{i},w} \right)},y_{i}} \right)} = {r^{- 1}{\sum\limits_{j = 1}^{r}\;\left( {{f_{j}\left( {I_{i},w_{j}} \right)} - y_{ij}} \right)^{2}}}},} & (34) \end{matrix}$

where y_(ij) is the j^(th) element of y_(i), which is y_(ij)∈R² in the detection of face landmark points and y_(ij)∈{−1, +1} in the recognition of AUs.

Without loss of generality, the system uses ƒ_(i) in lieu of ƒ(I_(i),w) and ƒ_(ij) instead of ƒ_(i) (I_(i),w_(j)). Note that the functions ƒ_(ij) are the same for all i, but may be different for distinct values of j.

The above derivations correspond to a local fit. That is, (33) and (34) attempt to optimize the fit of each one of the outputs independently and then take the average fit over all outputs.

The above derived approach has several solutions, even for a fixed fitting error

(.). For example, the error can be equally distributed across all outputs ∥ƒ_(ij)−y_(ij)∥₂≈∥ƒ_(ik)−y_(ik)∥₂, ∀j, k, where ∥.∥₂ is the 2-norm of a vector. Or, most of the error may be in one (or a few) of the estimates, defined as

∥ƒ_(ij) −y _(ij)∥₂>>∥ƒ_(ik) −y _(ik)∥₂ and ∥ƒ_(ik) −y _(ik)∥₂≈0, ∀k≠j

In some embodiments, an additional constraint is added to minimize the function

$\begin{matrix} {\frac{2}{r\left( {r + 1} \right)}{\sum\limits_{1 \leq j < k \leq r}{{\left( {f_{ij} - y_{ij}} \right) - \left( {f_{ik} - y_{ik}} \right)}}^{a}}} & (35) \end{matrix}$

with a≥1. The system adds global criterion that facilitates convergence.

Adding Global Structure

The system defines a set of constraints to add global structure extending global descriptors. The constraint in (34) is local because it measures the fit of each element of y_(i) (i.e., y_(ij)) independently. The same criterion can nonetheless be used to measure the fit of pairs of points; formally defined as

$\begin{matrix} {{{\mathcal{L}_{pairs}\left( {f_{i},y_{i}} \right)} = {\frac{2}{r\left( {r + 1} \right)}{\sum\limits_{1 \leq j < k \leq r}\left( {{g\left( {{h\left( f_{ij} \right)},{h\left( f_{ik} \right)}} \right)} - {g\left( {y_{ij},y_{ik}} \right)}} \right)^{2}}}},} & (36) \end{matrix}$

where g(x,z) is a function that computes the similarity between its two entries, and h(.) scales the (unconstrained) output of the network into the appropriate value range In landmark detection, h(ƒ_(ij))=ƒ_(ij)∈R² and

g(x,z)=∥x−z∥ _(b)  (37)

is the b-norm of x−z (e.g., the 2-norm, g(x, z)=√{square root over ((x−z)^(T)(x−z))}) where x and z are 2D vectors defining the image coordinates of two landmarks.

In AU recognition, h(ƒ_(ij))=sign(ƒ_(ij))∈{−1, +1} and

$\begin{matrix} {{g\left( {x_{ij},x_{ik}} \right)} = \left\{ \begin{matrix} {{1,}\ } & {{{if}\mspace{14mu} x_{ij}} = x_{ik}} \\ {{0,}\ } & {{otherwise},} \end{matrix} \right.} & (38) \end{matrix}$

where sign(.) returns −1 if the input number is negative and +1 if this number is positive or zero. x_(ij) is 1 if AU j is present in image I_(i) and −1 if it is not present in that image. Hence, the function h(.):R→{−1, +1}.

In some embodiments, the system takes into account the global structure of each pair of elements, i.e., each pair of landmark points in detection and each pair of AUs in recognition. That is, in detection, the system uses the information of the distance between all landmark points and, in recognition, determines where pairs of AUs co-occur (e.g. meaning that the two are simultaneously present or not present in the sample image).

In some embodiments, the global criterion can be extended to triplets. Formally,

$\begin{matrix} {{{\mathcal{L}_{trip}\left( {f_{i},y_{i}} \right)} = {\begin{pmatrix} r \\ 3 \end{pmatrix}^{- 1}{\sum\limits_{1 \leq j < k < s \leq r}\left\lbrack {{g\left( {{h\left( f_{ij} \right)},{h\left( f_{ik} \right)},{h\left( f_{is} \right)}} \right)} - {g\left( {y_{ij},y_{ik},y_{is}} \right)}} \right\rbrack^{2}}}},} & (39) \end{matrix}$

where g(x, z, u) is now a function that computes the similarity between its three entries.

In detection, this means the system can compute the b-norm, e.g., g(x, z, u)=∥(x−z)+(z−u)∥_(b), and the area of the triangle defined by each triplet is calculated as

g(x,z,u)=½|(x−z)×(x−u)|,  (40)

where the three landmark points are non-colinear.

In some embodiments, the equations can be extended to four or more points. For example, the equation can be extended to convex quadrilaterals as

${g\left( {x,z,u,v} \right)} = {\frac{\lambda}{2}{{\left( {x - u} \right) \times \left( {z - v} \right)}}_{.}}$

In the most general case, for t landmark points, the system computes an area of the polygon envelope, i.e., a non-self-intersecting polygon contained by the t landmark points {x_(i1), . . . , x_(it)} the polygon is given as follows.

The system computes a Delaunay triangulation of the facial landmark points. The polygon envelop is obtained by connecting the lines of the set of t landmark points in counter-clockwise order. The ordered set of landmark points is defined as {tilde over (x)}_(i)={{tilde over (x)}_(i1), . . . , {tilde over (x)}_(it)}. The area in {tilde over (x)}_(i) is given by,

$\begin{matrix} {{{g_{a}\left( {\overset{\_}{x}}_{i} \right)} = {\frac{1}{2}\left\lbrack {\left( {\sum\limits_{k = 1}^{t - 1}\;\left( {{{\overset{\sim}{x}}_{{ik}\; 1}{\overset{\sim}{x}}_{{i{({k + 1})}}2}} - {{\overset{\sim}{x}}_{{ik}\; 2}{\overset{\sim}{x}}_{{i{({k + 1})}}1}}} \right)} \right) + \left( {{{\overset{\sim}{x}}_{{it}\; 1}{\overset{\sim}{x}}_{i\; 12}} - {{\overset{\sim}{x}}_{i\; 12}{\overset{\sim}{x}}_{{it}\; 1}}} \right)} \right\rbrack}},} & (41) \end{matrix}$

where subscript a in g_(a)(.) denotes “area,” and {tilde over (x)}_(ik)=({tilde over (x)}_(ik1), {tilde over (x)}_(ik2))^(T).

In some embodiments, the result in the above equation is obtained using Green's theorem as known in the art and, {circumflex over (x)}_(i) can either be the t outputs of {tilde over (f)}_(i)={{tilde over (ƒ)}_(ij), . . . , {tilde over (ƒ)}_(it)} or the true values {tilde over (y)}_(i)={{tilde over (y)}_(ij), . . . , {tilde over (y)}_(it)}.

The system can compute the global b-norm, g_(n)(.), for the general case of t landmark points as,

$\begin{matrix} {{g_{n}\left( {\overset{\sim}{x}}_{i} \right)} = {\sum\limits_{k = 1}^{t - 1}{{{{\overset{˜}{x}}_{{ik}\; 1} - {\overset{\sim}{x}}_{{i{({k + 1})}}2}}}_{b}.}}} & (42) \end{matrix}$

The above derivations define the extension of g(.) to three and more points m detection problems. From this, the above can be used to recognize AUs in images.

The system computes a co-occurrence of three or more AUs in image I_(i). Formally. {tilde over (f)}_(i)={{tilde over (x)}_(ij), . . . , {tilde over (x)}_(it)} be a set of t AUs, with {tilde over (x)}_(ij)∈{−1, +1}, j=1, . . . , t, and

$\begin{matrix} {{g_{AU}\left( {\overset{\sim}{x}}_{i} \right)} = \left\{ \begin{matrix} {1,} & {{{{{if}\mspace{14mu}{\overset{\sim}{x}}_{i\; 1}}\operatorname{=.}}\;.\;.} = {\overset{\sim}{x}}_{it}} \\ {0,} & {{otherwise}.} \end{matrix} \right.} & (43) \end{matrix}$

GL-Loss

The final local-global (GL) loss function is given by,

(f _(i) ,y _(i))=α₀

_(local)(f _(i) ,y _(i))+

_(global)(f _(i) ,y _(i)),  (44)

where the global loss

_(global) is defined as

$\begin{matrix} {{{\mathcal{L}_{global}\left( {f_{i},y_{i}} \right)} = {\sum\limits_{t = 1}^{t_{\max}}\;{\alpha_{t}\left\lbrack {{g\left( {{h\left( {\overset{\_}{f}}_{ij} \right)},{.\;.\;.}\;,{h\left( {\overset{\_}{f}}_{it} \right)}} \right)} - {g\left( {{\hat{y}}_{ij},{.\;.\;.}\;,{\hat{y}}_{it}} \right)}} \right\rbrack}}},} & (45) \end{matrix}$

g(.) is either g_(a)(.) or g_(n)(.) or both in detection and g_(AU)(.) in recognition, and a_(i) are normalizing constants learned using cross-validation on a training set.

Backpropagation

To optimize the parameters of the DNN, w, the system computes

$\begin{matrix} {\frac{\partial\mathcal{L}}{\partial w} = {{\alpha_{0}\frac{\partial\mathcal{L}_{local}}{\partial w}} + {\frac{\partial\mathcal{L}_{global}}{\partial w}.}}} & (46) \end{matrix}$

The partial derivatives of the local loss is of course given by

$\begin{matrix} {\frac{\partial\mathcal{L}_{local}}{\partial w_{j}} = {\frac{2}{r}\frac{\partial f_{ij}}{\partial w_{j}}{\left( {f_{ij} - y_{ij}} \right).}}} & (47) \end{matrix}$

The definition of the global loss uses a mapping function h(.). In some embodiments, when performing landmark detection, h(ƒ_(ij))=ƒ_(ij) and the partial derivatives of the global loss have the same form as those of the local loss shown in the equation above. In other embodiments, when performing AU recognition, the system uses h(ƒ_(ij))=sign(ƒ_(ij))∈{−1,+1}. The function is not differentiable, however, the system redefines it as h(ƒ_(ij))=ƒ_(ij)/√{square root over (ƒ_(ij) ²+∈)}, for a small ∈>0. The partial derivative becomes ∂h(ƒ_(ij))/∂w_(j)=½+1/√{square root over (ƒ_(ij)+∈)}.

Deep DNN

The system includes a deep neural network for recognition of AUs. The DNN includes two parts. The first part of the DNN is used to detect a large number of facial landmark points. The landmark points allow the system to compute GL-loss as described above.

The system can compute normalized landmark points. The system can concatenate with the output of a first fully connected layer of a second part of the DNN to embed the location information of the landmarks into the DNN used to recognize AUs. This facilitates the detection of local shape changes typically observed in the expression of emotion. This is done m the definition of the GL-loss above.

In some embodiments, the DNN includes multiple layers. In an exemplary embodiment, nine layers are dedicated to the detection of facial landmark points, and other layers are used to recognize AUs in a set of images.

The layers devoted to the detection of facial landmark points are detailed as follows.

Facial Landmark Point Detection

In the exemplary embodiment, the DNN includes three convolutional layers, two max pooling layers and two fully connected layers. The system can apply normalization, dropout, and rectified linear units (ReLU) at the end of each convolutional layer.

The weights in these layers are optimized using back-propagation—using the derived GL-loss. The global loss and the backpropagation equations are provided above.

In an example, the system uses this part of the DNN to detect a total of 66 facial landmark points. One advantage of the proposed GL-loss is that it can be efficiently trained on very large datasets. In some embodiments, the system includes a facial landmark detector that employs data augmentation to be invariant to affine transformations and partial occlusions.

The facial landmark detector generates additional images by applying two-dimensional affine transformations to the existing training set, i.e., scale, reflection, translation and rotation. In an exemplary embodiment, scale can be taken between 2 and 0.5, rotation can be −10° to 10°, and translation and reflection can be randomly generated. To make the DNN more robust to partial occlusions, the system randomizes occluding boxes of d×d pixels, with d between 0.2 and 0.4 times the inter-eye distance.

AU Recognition

The second part of the DNN combines the face appearance features with the landmark locations given by the first part of the DNN. Specifically, in the output of the first fully connected layer of the second part of the DNN, the appearance image features are concatenated with the normalized automatically detected landmark points.

Formally, let s_(i)=(s_(i1) ^(T), . . . , s_(ip) ^(T))^(T) be the vector of landmark points in the ith sample image (i=1, . . . , n), where s_(ik)∈R² are the 2D image coordinates of the k^(th) landmark, and n is the number of sample images. Thus s_(i)∈R¹³². All images are then normalized to have the same inter-eye distance of t pixels. That is, ŝ_(i)=cs_(i), where

${c = \frac{\tau}{{\underset{\cdot}{l - r}}_{2}}},$

where l and r are the image coordinates of the center of the left and right eye, ∥⋅∥₂ defines the 2-norm of a vector, ŝ_(i)=(ŝ_(i1) ^(T), . . . , ŝ_(ip) ^(T))^(T) and can use τ=200.

The system normalizes the landmark points as ŝ_(ik)′=R(ŝ_(ik)−Î)+Î, where Î=cl, and multiplies the landmark points with a rotation matrix R to make the outer corner of left and right eye match a horizontal line. The system rescales and shifts the values i to move the outer corner of the left and right eye in an image to the pre-determined positions of ŝ_(i)′ (0.5, 0) and (−0.5, 0), respectively.

In one embodiment, the DNN is similarly to that of GoogleNet but with the major difference that the herein defined GL-loss is used. The input of the DNN can be a face image. The system changes the size of the filter in the first layer to adapt to the input, and randomly initializes the weight for these filters. In order to embed landmarks in the DNN, the number of filters in the first fully connected layer can be changed as well as the number of filters for output as the number of AUs. The system can employ a single DNN can be employed to detect all AUs in images of facial expressions.

The weights of the second part of the DNN can be optimized using backpropagation methods and with the global loss defined above.

In some embodiments, the data augmentation can be performed by adding random noise to 2D landmark points, and applying the affine transformations described above.

In some embodiments, the system can be trained to initialize recognition of AUs in the wild using a training database as described above.

FIG. 7 illustrates a network system 700 for detecting AUs and emotion categories using deep neural networks (DNN) in video and/or still images. The system 700 includes an image database component 710 having a set of videos and/or images. The system 700 includes a DNN 720 that determines AUs in the set of images of the image database 710. The DNN 720 includes a first part 730 that defines landmarks in the set of images as described above. The DNN 720 includes a second part 740 that determines AUs in the landmarks in the set of images in the database component 710 as described above. The system 700X includes a tagging component 750 that tags the images with at least one AU or no AU. The system 700 can store the tagged images in a processed image database 760.

Example Computing Device

FIG. 8 illustrates an exemplary computer that can be used for configuring hardware devices in an industrial automation system. In various aspects, the computer of FIG. 8 may comprise all or a portion of the development workspace 100, as described herein. As used herein, “computer” may include a plurality of computers. The computers may include one or more hardware components such as, for example, a processor 821, a random access memory (RAM) module 822, a read-only memory (ROM) module 823, a storage 824, a database 825, one or more input/output (I/O) devices 826, and an interface 827. Alternatively and/or additionally, controller 820 may include one or more software components such as, for example, a computer-readable medium including computer executable instructions for performing a method associated with the exemplary embodiments. It is contemplated that one or more of the hardware components listed above may be implemented using software. For example, storage 824 may include a software partition associated with one or more other hardware components. It is understood that the components listed above are exemplary only and not intended to be limiting.

Processor 821 may include one or more processors, each configured to execute instructions and process data to perform one or more functions associated with a computer for indexing images. Processor 821 may be communicatively coupled to RAM 822, ROM 823, storage 824, database 825, I/O devices 826, and interface 827. Processor 821 may be configured to execute sequences of computer program instructions to perform various processes. The computer program instructions may be loaded into RAM 822 for execution by processor 821. As used herein, processor refers to a physical hardware device that executes encoded instructions for performing functions on inputs and creating outputs.

RAM 822 and ROM 823 may each include one or more devices for storing information associated with operation of processor 821. For example, ROM 823 may include a memory device configured to access and store information associated with controller 820, including information for identifying, initializing, and monitoring the operation of one or more components and subsystems. RAM 822 may include a memory device for storing data associated with one or more operations of processor 821. For example, ROM 823 may load instructions into RAM 822 for execution by processor 821.

Storage 824 may include any type of mass storage device configured to store information that processor 821 may need to perform processes consistent with the disclosed embodiments. For example, storage 824 may include one or more magnetic and/or optical disk devices, such as hard drives, CD-ROMs. DVD-ROMs, or any other type of mass media device.

Database 825 may include one or more software and/or hardware components that cooperate to store, organize, sort, filter, and/or arrange data used by controller 820 and/or processor 821. For example, database 825 may store hardware and/or software configuration data associated with input-output hardware devices and controllers, as described herein. It is contemplated that database 825 may store additional and/or different information than that listed above.

I/O devices 826 may include one or more components configured to communicate information with a user associated with controller 820. For example, I/O devices may include a console with an integrated keyboard and mouse to allow a user to maintain a database of images, update associations, and access digital content. I/O devices 826 may also include a display including a graphical user interface (GUI) for outputting information on a monitor. U/O devices 826 may also include peripheral devices such as, for example, a printer for printing information associated with controller 820, a user-accessible disk drive (e.g., a USB port, a floppy, CD-ROM, or DVD-ROM drive, etc.) to allow a user to input data stored on a portable media device, a microphone, a speaker system, or any other suitable type of interface device.

Interface 827 may include one or more components configured to transmit and receive data via a communication network, such as the Internet, a local area network, a workstation peer-to-peer network, a direct link network, a wireless network, or any other suitable communication platform. For example, interface 727 may include one or more modulators, demodulators, multiplexers, de-multiplexers, network communication devices, wireless devices, antennas, modems, and any other type of device configured to enable data communication via a communication network.

While the methods and systems have been described in connection with preferred embodiments and specific examples, it is not intended that the scope be limited to the particular embodiments set forth, as the embodiments herein are intended in all respects to be illustrative rather than restrictive.

Unless otherwise expressly stated, it is in no way intended that any method set forth herein be construed as requiring that its steps be performed in a specific order. Accordingly, where a method claim does not actually recite an order to be followed by its steps or it is not otherwise specifically stated in the claims or descriptions that the steps are to be limited to a specific order, it is no way intended that an order be inferred, in any respect. This holds for any possible non-express basis for interpretation, including: matters of logic with respect to arrangement of steps or operational flow; plain meaning derived from grammatical organization or punctuation; the number or type of embodiments described in the specification. Throughout this application, various publications may be referenced. The disclosures of these publications in their entireties are hereby incorporated by reference into this application in order to more fully describe the state of the art to which the methods and systems pertain. It will be apparent to those skilled in the art that various modifications and variations can be made without departing from the scope or spirit. Other embodiments will be apparent to those skilled in the art from consideration of the specification and practice disclosed herein. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit being indicated by the following claims. 

What is claimed is:
 1. A computer-implemented method for analyzing an image to determine Action Unit (AU) and AU intensity using color features in the image, comprising: identifying changes defining transition of an AU from inactive to active, wherein the changes are selected from the group consisting of chromaticity, hue and saturation, and luminance; and applying a Gabor transform to the identified transition changes to gain invariance to a timing of the identified transition changes during a facial expression.
 2. The method of claim 1, further comprising: maintaining, in memory a plurality of trained color features data associated with an AU and/or AU intensity; receiving the image to be analyzed; and for each received image: determining configural color features of a face in the image due to facial muscle action; and determining none, one or more AU values for the image by comparing the determined configural color features to the plurality of trained color feature data to determine presence of the determined configural color features in one of more of the plurality of trained color feature data.
 3. The method of claim 1, further comprising: analyzing a plurality of faces in images or video frames to determine kernel or face space for a plurality of AU values and AU intensity values, wherein each kernel or face space is associated with at least one AU value and at least one AU intensity value, and wherein each kernel or face space is linear or non-linearly separable to other kernel and face space data, wherein the kernel or face space includes functional color space feature data; and training a deep neural network with a set of results of the analyzing of the plurality of faces in images or video frames.
 4. The method of claim 3, wherein the functional color space feature data is determined by performing a discriminant functional learning analysis on color images each derived from a given image of the plurality of faces in images or video frames.
 5. The method of claim 1, further comprising: identifying changes defining transition of an emotion from not present to present that are color transitions in a face in a video sequence resulting from blood flow in the face.
 6. The method of claim 1, further comprising modifying the analyzed image by: modifying at least one of the group consisting of chromaticity, hue and saturation, and luminance of the analyzed image to yield an appearance of a determined expression of an emotion or of a second AU.
 7. The method of claim 1, further comprising modifying the analyzed image by: modifying at least one of the group consisting of chromaticity, hue and saturation, and luminance to increase or decrease an intensity of a determined emotion or the AU to change a perception of the determined emotion or the AU.
 8. A computer-implemented method for analyzing an image to determine AU and AU intensity in face images, comprising: training a deep neural network with a set of training images having faces, wherein the deep neural network is trained to identify AU in the face images; and identifying local loss and global loss with the deep neural network in the face images to determine AUs in the face images.
 9. The method of claim 8, wherein the deep neural network includes comprising: detecting a plurality of landmark points with a first part of the deep neural network, wherein the landmark points facilitate calculating the global loss; and detecting local image changes with a second part of the deep neural network, wherein the landmark points are normalized and concatenated to embed location information of the landmark points into the deep neural network.
 10. The method of claim 9, wherein the deep neural network includes a plurality of layers for identifying landmarks in the image and a second plurality of layers to recognize AUs in the face images.
 11. The method of claim 8, further comprising: determining a neutral face of an image in the face images, the neutral face having color; and modifying the color of the image of the neutral face to yield an appearance of a determined expression of an emotion or of a second AU.
 12. The method of claim 8, further comprising: determining a neutral face of an image in the face images, the neutral face characterized by the group consisting of chromaticity, hue and saturation, and luminance; and modifying at least one of the group consisting of chromaticity, hue and saturation, and luminance of the image of the neutral face to yield an appearance of a determined expression of an emotion or of a second AU.
 13. The method of claim 8, further comprising: determining an emotion or AU in an image of the face images, the image having color, determining an intensity of the determined emotion or AU; and modifying the color of the image to increase or decrease the intensity of the determined emotion or AU to change a perception of the emotion or the AU.
 14. The method of claim 8, further comprising: determining an emotion or AU in an image of the face images, the image characterized by the group consisting of chromaticity, hue and saturation, and luminance, determining an intensity of the determined emotion or AU; and modifying at least one of the group consisting of chromaticity, hue and saturation, and luminance of the image to increase or decrease the intensity of the determined emotion or AU to change a perception of the emotion or the AU.
 15. A non-transitory computer readable medium storing computer-executable instructions that when executed by a computer cause the computer to perform a method for analyzing an image to determine AU and AU intensity in face images, the method comprising: training a deep neural network with a set of training images having faces, wherein the deep neural network is trained to identify AU in the face images; and identifying local loss and global loss with the deep neural network in the face images to determine AUs in the face images.
 16. The non-transitory computer readable medium of claim 15, wherein the method further comprises: detecting a plurality of landmark points with a first part of the deep neural network, wherein the landmark points facilitate calculating the global loss; and detecting local image changes with a second part of the deep neural network, wherein the landmark points are normalized and concatenated to embed location information of the landmark points into the deep neural network.
 17. The non-transitory computer readable medium of claim 16, wherein the deep neural network includes a plurality of layers for identifying landmarks in the image and a second plurality of layers to recognize AUs in the face images.
 18. The non-transitory computer readable medium of claim 15, wherein the method further comprises: determining a neutral face of an image in the face images, the neutral face having color; and modifying the color of the image of the neutral face to yield an appearance of a determined expression of an emotion or of a second AU.
 19. The non-transitory computer readable medium of claim 15, wherein the method further comprises: determining a neutral face of an image in the face images, the neutral face characterized by the group consisting of chromaticity, hue and saturation, and luminance; and modifying at least one of the group consisting of chromaticity, hue and saturation, and luminance of the image of the neutral face to yield an appearance of a determined expression of an emotion or of a second AU.
 20. The non-transitory computer readable medium of claim 15, wherein the method further comprises: determining an emotion or AU in an image of the face images, the image having color, determining an intensity of the determined emotion or AU; and modifying the color of the image to increase or decrease the intensity of the determined emotion or AU to change a perception of the emotion or the AU. 